<%@page import="com.shop.domain.User"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"  contentType="text/html; charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>${goodsDetail.getName() }</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" href="<%=basePath%>css/style.css" type="text/css">
	<link rel="stylesheet" href="<%=basePath%>css/detail.css" type="text/css">

  </head>
  
  <body>
	<div id="top">
    	<ul class="inTop clearfix">
        <li class="fl shoucang"><a href="#">收藏本站</a></li>
        <li class="fl" id="guanzhu">
            <a class="wxFocus" href="#">关注我</a>
            <div class="weiCode" style="display: none;">
                <span></span>
            </div>
        </li>
        
        <li class="fr"><a href="http://www.taoertao.com/about.php?part=faq" target="_blank">客户服务</a></li>
        <li class="fr"><a href="">消息中心</a></li>
        <li class="fr"><a href="">购物车</a></li>
        <li class="fr"><a href="jsp/certify.jsp">实名认证</a></li>
        <%
        	String username = ((User)session.getAttribute("currentUser")).getUsername();
        	if(username == null || username.length() == 0 || username.equals("")){	
         %>
         	<li>
         		 <a href="jsp/regist.jsp">注册</a>
         		 <a href="jsp/login.jsp"><strong>登录</strong></a>
         	</li>
        <%
      		} else{
       	%> 
       	
	        <li class="fr">您好，<%=username%>&nbsp;
	        	<a href="">已买到的宝贝</a>
	        	<a href="">已出售的商品</a>
	        	<a href="">出售中的商品</a>
	        	<a href="">收藏夹</a>
	        </li> 
	    <%
       		}
        %>    
	        
    </ul>
	</div>
	
	<div id="header">
	<div class="inHeader clearfix">
        <div class="midHeader clearfix">
        	<div class="logo fl">
            	<a href="user/index.do"><img src="images/logo.gif" title="猴子商城"></a>
            </div>
            <div class="searchArea fl">
            	<form method="get" action="goods/search.do" target="_blank">
                	<input type="text" name="keyword" class="keyword fl" placeholder="搜索你想要的宝贝">
                    <input type="submit" class="seaBtn fr" value="搜索">
                </form>
                <ul class="clearfix">
                	<li>热门搜索：</li>
                    <li><a href="#">自行车</a></li>
                    <li><a href="#">笔记本</a></li>
                    <li><a href="#">考研资料</a></li>
                    <li><a href="#">手机</a></li>
					<div style="display: inline-block; width: 380px; height: 22px; overflow: hidden; margin-top: 1px;">
					</div>
                </ul>
            </div>	    	
	   </div>
	</div>
	</div>
	
	<div class="container1200">
		<div class="ershou-details">
			<div class="ershou-photos-wr"></div>
			<div class="ershou-info">
                    <div class="ershou-hd">
                        <h2 class="ershou-title">${goodsDetail.getName() }</h2>
                        <div class="ershou-price discount">
                            <span>${goodsDetail.getPrice() }</span>
                        </div>
                    </div>
                    <ul class="ershou-detail">
                        <li class="ershou-place">
                            <div class="name"><span>成色</span></div>
                            <div class="value"><span>${goodsDetail.getDegree() }成新</span></div>
                        </li>
                        <li class="ershou-place">
                            <div class="name"><span>交易方式</span></div>
                            <div class="value"><span>
                                <c:if test="${goodsDetail.getTransactionMode()==true }">在线交易</c:if>
                                <c:if test="${goodsDetail.getTransactionMode()==false }">线下交易</c:if>
                            </span></div>
                        </li>
                        <c:if test="${goodsDetail.getTransactionMode()==false }">
                            <li class="ershou-place">
                            <div class="name"><span>交易地点</span></div>
                            <div class="value"><span>${goodsDetail.getTransactionAddress() }</span></div>
                            </li>
                        </c:if>
                        <li class="ershou-seller">
                            <div class="name"><span>卖家</span></div>
                            <div class="value"><span class="value-name">${goodsDetail.getSeller() }</span></div>
                        </li>
                        <li class="ershou-cert">
                            <div class="name"><span>认证状态</span></div>
                            <div class="value"><span>实名认证通过 V</span></div>
                        </li>
                        <li class="ershou-time">
                            <div class="name"><span>更新时间</span></div>
                            <div class="value"><span class="real-time">${goodsDetail.getRecentUpdate() }</span></div>
                        </li>
                    </ul>
                    <a href="goods/buy.do?id=${goodsDetail.getId() }" ><img src="images/buy.jpg" alt="立即购买"></a>
                    <a href="goods/addCart.do?id=${goodsDetail.getId() }" ><img src="images/cart.jpg" alt="加入购物车"></a>

                    <div class="jiathis_style_32x32" style="margin-top: 25px;height:32px;line-height: 32px;margin-left: 25px;">
                        <span style="display: inline-block;float: left;font-size: 14px;color: #666;">分享到：</span>
                        <a class="jiathis_button_qzone" title="分享到QQ空间"><span class="jiathis_txt jtico jtico_qzone"></span></a>
                        <a class="jiathis_button_tsina" title="分享到新浪微博"><span class="jiathis_txt jtico jtico_tsina"></span></a>
                        <a class="jiathis_button_tqq" title="分享到腾讯微博"><span class="jiathis_txt jtico jtico_tqq"></span></a>
                        <a class="jiathis_button_weixin" title="分享到微信"><span class="jiathis_txt jtico jtico_weixin"></span></a>
                        <a class="jiathis_button_renren" title="分享到人人网"><span class="jiathis_txt jtico jtico_renren"></span></a>
                        <a id="goods_button_more" href="http://www.jiathis.com/share" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank"></a>
                    </div>            
                </div>
		</div>
		<div class="ershou-desc">
			<p>宝贝详情</p>
			<div class="desc clearfix">
				<span id="user_cmt">${goodsDetail.getDescription() }</span>
			</div>
		</div>
		
		<div class="comments">
                <div class="comments-title">评论</div>
                <div class="comments-wr">
                    <div class="comment-wr">
                    
                    		<c:forEach items="${goodsDeatil.getComments() }" var="com">
	                            <div class="comment">
	                            <div class="commentator">${com.getUsername() }</div>
	                                <p class="comment">${com.getContent() }</p>
	                                <p class="comment">${com.getCreateTime() }</p>
	                            </div>
                            </c:forEach> 
                            <div class="post-comment clearfix">
                            <div class="comment-cover">
                                <span class="loader loader-quart"></span>
                            </div>
                            <input id="goods_id" type="hidden" value="${goods.getId() }">                                                
                            <div class="commenting clearfix">
                                <div class="comment-input-wr-wr">
                                    <div class="comment-input-wr">
                                        <textarea class="comment-input" name="comment-input" id="comment-input"></textarea>
                                    </div>
                                </div>
                                <button class="sub-comment" type="button">评论</button>
                            </div>
                            </div>
                    </div>
                </div>
            </div>
	</div>
	
	<script type="text/javascript" src="<%=basePath%>/js/jquery-1.11.2.min.js"></script>
	<script type="text/javascript" src="<%=basePath%>/js/common.js"></script>
	<script type="text/javascript" src="<%=basePath%>/js/index.js"></script>
	
  </body>
</html>
